{{extend 'layout.html'}}
<div class="icon-overview center" style="margin:0 0 10px 0; border:0;">
	<a href="{{=URL('manage', 'index')}}">{{=H4(T('Back to overview'), _style="padding:4px 10px;")}}</a>
</div>
<div style="clear:both;"></div>
{{if row.auth_group.quiz=='quizpersonal':}}
{{=H1(T('Personal Quiz'))}}<br>
<div>
	<div class="icon-overview left">
		<a href="{{=URL('manage', 'personal/%s/' % (row.auth_group.id))}}">{{=H2(row.auth_group.role)}}</a>
		{{if row.stats.personal_total is not None:}}<div class="count">{{=row.stats.personal_total}}</div>{{pass}}
	</div>
	{{for i in range(1,7):}}
	<div class="icon-overview grey center" style="z-index:{{=(15-i)}};">
		<a href="{{=URL('manage', 'personal/%s/%s/' % (row.auth_group.id, i))}}">{{=H2(i)}}</a>
		{{if row.stats['personal_%s'%i]:}}<div class="count">{{=row.stats['personal_%s'%i]}}</div>{{pass}}
	</div>
	{{pass}}
	<div style="clear:both;"></div>
</div>	
{{elif row.auth_group.quiz=='quizregional':}}
{{=H1(T('Regional Quiz'))}}<br>
<div>
	<div class="icon-overview left">
		<a href="{{=URL('manage', 'regional/%s/' % (row.auth_group.id))}}">{{=H2(row.auth_group.role)}}</a>
		{{if row.stats.regional_total is not None:}}<div class="count">{{=row.stats.regional_total}}</div>{{pass}}
	</div>
	{{for i in range(1,7):}}
	<div class="icon-overview grey center" style="z-index:{{=(8-i)}};">
		<a href="{{=URL('manage', 'regional/%s/%s/' % (row.auth_group.id, i))}}">{{=H2(i)}}</a>
		{{if row.stats['regional_%s'%i]:}}<div class="count">{{=row.stats['regional_%s'%i]}}</div>{{pass}}
	</div>
	{{pass}}
	<div style="clear:both;"></div>
</div>
{{pass}}
<div style="width:440px; float:left; margin-right:20px;">
<div class="group">
<div class="group-left" style="line-height:90%;"><br>{{=T('Name')}}:</div>
<div class="group-right">{{=H2(row.auth_group.role, _style="font-size: 20px; line-height:120%;")}}</div>
<div class="group-left">{{=T('Quiz')}}:</div>
{{if row.auth_group.quiz == 'quizpersonal':}}<div class="group-right">{{=B(T('Personal Quiz'))}}</div>
{{elif row.auth_group.quiz == 'quizregional':}}<div class="group-right">{{=B(T('Regional Quiz'))}}</div>{{pass}}
{{if row.auth_group.description:}}
	<div class="group-left">{{=T('Description')}}:</div>
	<div class="group-right">{{=row.auth_group.description}}</div>
{{pass}}
<div style="clear:both;"></div>
</div>

<div class="group">
	<div class="group-left">{{=H2(T('Administrator'))}}</div>
	<div class="group-right">&nbsp;</div>
	{{if admin.facebook_id:}}<div class="group-left">{{=A(B('%s %s' % (admin.first_name, admin.last_name)), _href=admin.facebook_id, _target="_blank", _style="color:#333;")}}</div>
	{{else:}}<div class="group-left">{{=B('%s %s' % (admin.first_name, admin.last_name))}}</div>{{pass}}
	<div class="group-right">{{=admin.email}}</div>
	{{if members:}}
		<div class="group-left">{{=H2(T('Users'))}}</div>
		<div class="group-right">&nbsp;</div>
		{{for member in members:}}
			{{if member.auth_user.facebook_id:}}<div class="group-left">{{=A(B('%s %s' % (member.auth_user.first_name, member.auth_user.last_name)), _href=member.auth_user.facebook_id, _target="_blank", _style="color:#333;")}}</div>
			{{else:}}<div class="group-left">{{=B('%s %s' % (member.auth_user.first_name, member.auth_user.last_name))}}</div>{{pass}}
			<div class="group-right">{{=member.auth_user.email}}</div>
		{{pass}}
	{{pass}}
	<div style="clear:both;"></div>
</div>

<div class="icon-overview blue center" style="margin:0 0 10px 0; border:0;">
	{{if request.args(1) == 'invite':}}<a href="{{=URL('manage', 'group', args=(request.args(0)))}}">{{=H2(T('Invite someone to join'), _style="padding-left:18px;")}}</a>
	{{else:}}<a href="{{=URL('manage', 'group', args=(request.args(0), 'invite'))}}">{{=H2(T('Invite someone to join'), _style="padding-left:18px;")}}</a>{{pass}}
</div>
<div style="clear:both;"></div>

{{if request.args(1) == 'invite':}}
<div class="group" style="margin-top: -20px; padding-top:20px;">
{{=H2(T('Enter someone\'s FaceBook E-mailaddress'))}}
{{=form}}
</div>
{{pass}}
</div>
<div style="width:440px; float:left;">
{{if invites:}}
<div class="group">
	<div class="group-left">{{=H2(T('Invites'))}}</div>
	<div class="group-right">&nbsp;</div>
	{{for invite in invites:}}
		{{if invite.status == 'accepted':}}<div class="group-left">{{=B(invite.email)}}</div><div class="group-right">{{=T('Accepted')}} <span style="font-size:11px;">({{=invite.modified_on}})</span></div>
		{{elif invite.status == 'denied':}}<div class="group-left">{{=B(invite.email)}}</div><div class="group-right">{{=T('Denied')}} <span style="font-size:11px;">({{=invite.modified_on}})</span></div>
		{{elif invite.status == 'reinvited':}}<div class="group-left">{{=B(invite.email)}}</div><div class="group-right">{{=T('Reinvited')}} <span style="font-size:11px;">({{=invite.modified_on}})</span></div>
		{{elif invite.status == 'pending':}}<div class="group-left">{{=B(invite.email)}}</div><div class="group-right">{{=T('Pending')}} <span style="font-size:11px;">({{=invite.created_on}})</span></div>{{pass}}
	{{pass}}
	<div style="clear:both;"></div>
</div>
{{pass}}
</div><div style="clear:both;"></div>
